package com.itheima.admin.controller;

import com.itheima.admin.pojo.AdSensitive;
import com.itheima.admin.service.AdSensitiveService;
import com.itheima.common.dto.PageRequestDto;
import com.itheima.common.vo.PageResultVo;
import com.itheima.core.controller.AbstractCoreController;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: itheima-leadnews
 * @description: 敏感词
 * @author: pw
 * @create: 2022-08-10 10:27
 **/
@RestController
@RequestMapping("/sensitive")
public class SensitiveController extends AbstractCoreController<AdSensitive> {

    private AdSensitiveService adSensitiveService;

    //    增删改查的抽象类
    @Autowired
    public SensitiveController(AdSensitiveService adSensitiveService) {
        super(adSensitiveService);
        this.adSensitiveService = adSensitiveService;
    }

    @PostMapping("/list")
    @ApiOperation(value = "敏感词分页查询")
    public PageResultVo<AdSensitive> list(@RequestBody PageRequestDto pageRequestDto) {
        PageResultVo<AdSensitive> pageResultVo = findByPage(pageRequestDto);
        return pageResultVo;
    }
}
